package com.cms.admin.service.bill.impl;

import com.cms.admin.mapper.UserAccountVoucherBillMapper;
import com.cms.admin.model.PageBean;
import com.cms.admin.model.UserAccountVoucherBill;
import com.cms.admin.model.UserAccountVoucherBillExt;
import com.cms.admin.service.bill.IUserAccountVoucherBillService;

import java.util.List;

/**
 * Created by YYY-Work on 2017/5/25.
 */
public class UserAccountVoucherBillServiceImpl implements IUserAccountVoucherBillService{

    private UserAccountVoucherBillMapper userAccountVoucherBillMapper;


    @Override
    public List<UserAccountVoucherBill> queryVoucherBill(PageBean page,UserAccountVoucherBillExt record) {

        long count = getRowCount(record);
        page.setAllRow(count);

        record.setOffset(page.getOffset());
        record.setPageSize(page.getPageSize());
        return userAccountVoucherBillMapper.selectByConditionWithLimit(record);

    }

    @Override
    public long getRowCount(UserAccountVoucherBillExt record) {
        return userAccountVoucherBillMapper.countByCondition(record);
    }

    public UserAccountVoucherBillMapper getUserAccountVoucherBillMapper() {
        return userAccountVoucherBillMapper;
    }

    public void setUserAccountVoucherBillMapper(UserAccountVoucherBillMapper userAccountVoucherBillMapper) {
        this.userAccountVoucherBillMapper = userAccountVoucherBillMapper;
    }
}
